<?php 

namespace comments\model;

require_once("posts/model/Post.php");

class Comment {
	
	/**
	 * @var date $date
	 */
	public $date;

	/**
	 * @var string $comment
	 */
	public $comment;

	/**
	 * @var int $commenOwner
	 */
	public $commentOwner;

	/**
	 * @var int $postId
	 */
	public $postId;

	/**
	 * @var int $postId
	 */
	public $commentId;

	public function __construct($comment, $commentOwner, $date, $id) {
		$this->comment = $comment;
		$this->commentOwner = $commentOwner;
		$this->date = $date;
		$this->commentId = $id;
		$this->setPostId();
	}

	/**
	 * get the postId from posts\model\Post
	 */
	private function setPostId() {
		if (isset($_SESSION[\posts\model\Post::postId])) {
			$this->postId = $_SESSION[\posts\model\Post::postId];
		}
	}
}